package com.woniu.dao;

import com.woniu.domain.Courseware;
import com.woniu.domain.WareCation;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: ljy  <br/>
 * Date: 2021/6/8:12:18  <br/>
 * Description:课件持久化接口
 */
public interface CoursewareDao {

    @ApiOperation(value = "根据课件id查询")
    @ApiImplicitParam(name = "coursewareId", value = "课件id")
    Courseware getCourseById(@Param("coursewareId") Integer coursewareId);

    @ApiOperation(value = "添加课件")
    @ApiImplicitParam(name = "courseware", value = "课件对象")
    int addCourseware(Courseware courseware);

    @ApiOperation(value = "修改课件")
    @ApiImplicitParam(name = "courseware", value = "课件对象")
    int updateCourseware(Courseware courseware);

    @ApiOperation(value = "分页显示课件列表")
    List<Courseware> findCoursewareByPage();


    @ApiOperation(value = "根据课件id删除")
    @ApiImplicitParam(name = "coursewareId",value = "课件id")
    void delWareById(Integer coursewareId);


    @ApiOperation(value = "根据课件名称和类别搜索")
    @ApiImplicitParam(name = "obj",value = "课件名称和类别")
    List<Courseware> getCourseByCondition(Courseware obj);


    @ApiOperation(value = "查询所有父类别及对应的子类别")
    List<WareCation> cationQuery();


    @ApiOperation(value = "根据父id查询对应的子菜单")
    @ApiImplicitParam(name = "fid",value = "父菜单id")
    List<WareCation> cationGetById(@Param("fid") Integer fid);


    @ApiOperation(value = "批量更新课件对应的章节id")
    @ApiImplicitParam(name = "coursewares",value = "课件集合")
    int batchUpdateCourseware(List<Courseware> coursewares);


    @ApiOperation(value = "查询所有没有对应章节的课件")
    List<Courseware> coursewareQuery();

    //查询课程对应课件
    @ApiOperation(value = "根据课程id查询课件")
    @ApiImplicitParam(name = "userId",value = "课程id")
    List<Courseware> getDate(Integer courseId);
	

}
